/*构建service层
* param1： service名
* body
* */
app.service("brandServcie",function ($http) {

    /*查询特定类型列表*/
    this.findList = function () {
        return $http.get('../brand/findList.do');
    }

    /*分页查询*/
    this.search = function (pageNum,pageSize,name) {
        return $http.get('../brand/findByPagination.do?pageNum='+pageNum+'&pageSize='+pageSize+'&name='+name);
    }

    /*添加*/
    this.add = function (entity) {
        return $http.post("../brand/addTbBrand.do",entity);
    }

    /*修改*/
    this.upd = function (entity) {
        return $http.post("../brand/updTbBrand.do",entity)
    }

    /*根据id获取*/
    this.getOne = function (id) {
        return $http.get("../brand/getById.do?id="+id);
    }

    /*删除*/
    this.del = function (idArray) {
        return $http.get("../brand/delByIds.do?idList="+idArray);
    }

});